package com.software.usercenter.exception;

import com.software.usercenter.domain.Result;
import com.software.usercenter.utils.ResultUtil;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
/**
 * Author: zk
 * Description: 项目自定义异常的处理器 当抛出异常 跳到这里处理
 */
@RestControllerAdvice
public class BizExceptionHandler {

    @ExceptionHandler(BizException.class)
    public Result handlerException(BizException e) {
        return ResultUtil.error("500", e.getMessage(), null);
    }
}
